Skip to content

Fix a crash when opening the debug menu with a corrupted savegame - #6958

Merged
serprex merged 1 commit into
HarbourMasters:developfrom
bassdr:fix/inventory-debug-menu-on-corrupted-savegame
Jul 22, 2026
Merged

Fix a crash when opening the debug menu with a corrupted savegame#6958
serprex merged 1 commit into
HarbourMasters:developfrom
bassdr:fix/inventory-debug-menu-on-corrupted-savegame

Conversation

@bassdr

@bassdr bassdr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

I did not find the root cause of the corruption in the first place, it was while trying to test different cases of #6951, but this crash was preventing me to restore my savegame to a valid state, as the debut tool's saveeditor inventory menu was crashing on me.

The corruption was: the bow was replaced by a golden skultula, no clue why. I was able to assign the skultula to a C trigger, but using it was also crashing the game. This is addressing only the Debug Inventory Menu crash.

Build Artifacts

@bassdr
bassdr force-pushed the fix/inventory-debug-menu-on-corrupted-savegame branch from cc983f9 to e1463a8 Compare July 22, 2026 00:51
@bassdr
bassdr force-pushed the fix/inventory-debug-menu-on-corrupted-savegame branch from e1463a8 to 18fac2e Compare July 22, 2026 00:59
@serprex
serprex merged commit 92afa81 into HarbourMasters:develop Jul 22, 2026
5 checks passed
@bassdr
bassdr deleted the fix/inventory-debug-menu-on-corrupted-savegame branch July 24, 2026 11:58
PurpleHato added a commit to PurpleHato/Shipwright that referenced this pull request Jul 30, 2026
Integrate the latest Shipwright develop (LUS Fast3dGui texture-API refactor,
HarbourMasters#6723 icon-based rando items, HarbourMasters#6958 corrupted-save crash fix, HarbourMasters#5838 GBK/LACS
decouple) with the V2 save-editor rework. debugSaveEditor.cpp was the only
conflicted file (10 hunks).

Resolved by keeping V2's card-based layout and equipped-slot colored borders,
while adopting develop's API, typing, and guards:
- Migrated every texture lookup to Fast3dGui via GetRawInstance + the 4-arg
  LoadGuiTexture signature; kept V2's RG_ROCS_FEATHER(_PICKER) rando textures.
- Applied HarbourMasters#6958 hardening: guarded every itemMapping.find()->second against
  end(), and added SLOT_NONE bounds checks in DrawInventoryTab and the
  button-item helpers.
- Took HarbourMasters#5838's RSK_TRIFORCE_HUNT_PIECES_TOTAL>0 guard (V2 styling kept).
- Kept V2's DrawEquipmentTab, small-key count/-1/MQ work, and player-state cards.
- Fixed warnings that became errors under HarbourMasters#6733 (treat-warnings-as-errors):
  static_cast<s8> for the widened magicCapacity/ItemID fields and changed the
  GetMaxKeysForDungeon "no keys" sentinel from 255 to -1 (its int8_t value).

Advanced submodules (libultraship/OTRExporter/ZAPDTR) to the merge's recorded
commits. Builds clean (soh.exe, Release x64); clang-format clean.

Co-Authored-By: Claude <noreply@anthropic.com>
PurpleHato added a commit to PurpleHato/Shipwright that referenced this pull request Jul 30, 2026
Integrate the latest Shipwright develop (LUS Fast3dGui texture-API refactor,
HarbourMasters#6723 icon-based rando items, HarbourMasters#6958 corrupted-save crash fix, HarbourMasters#5838 GBK/LACS
decouple) with the V2 save-editor rework. debugSaveEditor.cpp was the only
conflicted file (10 hunks).

Resolved by keeping V2's card-based layout and equipped-slot colored borders,
while adopting develop's API, typing, and guards:
- Migrated every texture lookup to Fast3dGui via GetRawInstance + the 4-arg
  LoadGuiTexture signature; kept V2's RG_ROCS_FEATHER(_PICKER) rando textures.
- Applied HarbourMasters#6958 hardening: guarded every itemMapping.find()->second against
  end(), and added SLOT_NONE bounds checks in DrawInventoryTab and the
  button-item helpers.
- Took HarbourMasters#5838's RSK_TRIFORCE_HUNT_PIECES_TOTAL>0 guard (V2 styling kept).
- Kept V2's DrawEquipmentTab, small-key count/-1/MQ work, and player-state cards.
- Fixed warnings that became errors under HarbourMasters#6733 (treat-warnings-as-errors):
  static_cast<s8> for the widened magicCapacity/ItemID fields and changed the
  GetMaxKeysForDungeon "no keys" sentinel from 255 to -1 (its int8_t value).

Advanced submodules (libultraship/OTRExporter/ZAPDTR) to the merge's recorded
commits. Builds clean (soh.exe, Release x64); clang-format clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants